#!/usr/bin/env bash

binDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ${binDir} && cd ../
curDir=`pwd`

if [ ! -n "$PRO_PATH" ]; then
    export PRO_PATH="${curDir}"
fi

profiles=$2
rootDir=${curDir}
libPath=${rootDir}/lib
sourcePath=${rootDir}/conf
logPath=${rootDir}/logs

export PRO_PATH="${curDir}"
export ModuleName="haizhi"

if [ ! -d ${logPath} ]; then
    mkdir -p ${logPath}
fi
packageName=${curDir##*/}

start() {
    echo "start ${ModuleName}..."
    java -Dloader.path=${libPath},${sourcePath}  -jar  ${libPath}/${packageName}.jar ${profiles}
}

start